package com.cheng.common.utils;

import com.cheng.data.vo.ReqPageInfoVO;
import com.cheng.data.vo.RespPageInfoVO;
import com.github.pagehelper.PageInfo;

/**
 * @author: ChengJW
 * @date: 2021/12/17 8:51
 * @version: 1.0
 * @description: 响应数据分页工具类
 */
public class RespUtils {

    public static RespPageInfoVO respPageInfoVO(PageInfo pageInfo){
        RespPageInfoVO respPageInfoVO = new RespPageInfoVO();
        respPageInfoVO.setList(pageInfo.getList());
        respPageInfoVO.setPageNum(pageInfo.getPageNum());
        respPageInfoVO.setPageSize(pageInfo.getPageSize());
        respPageInfoVO.setPageCount(pageInfo.getTotal());
        return  respPageInfoVO;
    }
}
